<template>
  <el-dialog :visible.sync="dialog" append-to-body width="60%" :title="title" height="50%">
    <!--表格渲染-->
    <el-table v-loading="loading" :data="data" :show-summary="data.length > 1" style="width: 100%;margin-top: -10px; margin-left: -10px;">
      <el-table-column prop="model" label="型号" width="200px" />
      <el-table-column prop="color" label="颜色" />
      <el-table-column prop="size" label="尺码" />
      <el-table-column prop="style" label="男女款" />
      <el-table-column prop="quantity" label="件数" />
      <el-table-column prop="unitPrice" label="单价" />
      <el-table-column prop="totalPrice" label="总价" />
    </el-table>
  </el-dialog>
</template>

<script>
import crud from '@/mixins/crud'
export default {
  mixins: [crud],
  props: {
    masterId: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      title: '订单明细'
    }
  },
  methods: {
    doInit() {
      this.$nextTick(() => {
        this.init()
      })
    },
    // 获取数据前设置好接口地址
    beforeInit() {
      this.url = 'api/orderDetail'
      this.size = 999
      this.params = { masterId: this.masterId }
      return true
    }
  }
}
</script>

<style>
  .el-dialog {
    padding: 10px;
  }
  .java.hljs{
    color: #444;
    background: #ffffff !important;
  }
 ::v-deep .el-dialog__body{
    padding: 0 20px 10px 20px !important;
  }
</style>
